{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 多进程\n",
    "\n",
    "进程间通信：消息队列，socket\n",
    "\n",
    "进程的缺点：占内存\n",
    "\n",
    "# 多线程\n",
    "\n",
    "线程间通信：共享变量\n",
    "\n",
    "缺点：竞争状态，需要互斥锁来解决，容易形成死锁\n",
    "\n",
    "\n",
    "多进程和多线程都是同步模型\n",
    "\n",
    "request ---> server sleep(100) ---> response，然后处理下一个请求\n",
    "\n",
    "\n",
    "# 多路复用IO/异步IO/协程/事件轮询(ajax)/事件驱动\n",
    "\n",
    "java代表库：netty\n",
    "单线程异步模型\n",
    "\n",
    "第一个请求睡眠一分钟，第二个请求返回hello world，这两个请求注册到红黑树上，第二个请求先处理完，激活红黑树上的第二个请求的事件节点，内核通知server，server将第二个请求的响应返回给客户端\n",
    "\n",
    "event poll ---> epoll\n",
    "\n",
    "select, poll, epoll\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 布隆过滤器"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "概率查询\n",
    "\n",
    "如果url在布隆过滤器的标志位为1，url不一定在集合中\n",
    "\n",
    "如果url在布隆过滤器的标志位为0，那么url一定不在集合中\n",
    "\n",
    "[布隆过滤器](https://github.com/confucianzuoyuan/blockchain-tutorial/blob/master/%E6%AF%94%E7%89%B9%E5%B8%81%E6%95%99%E7%A8%8B/%E6%AF%94%E7%89%B9%E5%B8%81%E6%95%99%E7%A8%8B-%E7%90%86%E8%AE%BA/%E7%AC%AC%E5%85%AB%E7%AB%A0-%E6%AF%94%E7%89%B9%E5%B8%81%E7%BD%91%E7%BB%9C.md)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
